import request from '@/utils/request'

// 查询TaskForce列表
export function listTaskForce(query) {
  return request({
    url: '/Task Force/TaskForce/list',
    method: 'get',
    params: query
  })
}

// 查询TaskForce详细
export function getTaskForce(id) {
  return request({
    url: '/Task Force/TaskForce/' + id,
    method: 'get'
  })
}

// 新增TaskForce
export function addTaskForce(data) {
  return request({
    url: '/Task Force/TaskForce',
    method: 'post',
    data: data
  })
}

// 修改TaskForce
export function updateTaskForce(data) {
  return request({
    url: '/Task Force/TaskForce',
    method: 'put',
    data: data
  })
}

// 删除TaskForce
export function delTaskForce(id) {
  return request({
    url: '/Task Force/TaskForce/' + id,
    method: 'delete'
  })
}

// 查询TaskForce关联的队伍表

export function getTeamsByTaskForceId(id){
  return request({
    url: '/Task Force/TaskForce/getTeamsByTaskForceId/' + id,
    method: 'get'
  })
}

// 保存队伍
export function AddTeam(data){
  return request({
    url: '/Task Force/TaskForce/AddTeam',
    method: 'post',
    data: data
  })
}

// 删除人员
export function DeleteMbers(id){
  return request({
    url: '/Task Force/TaskForce/DeleteEmbers/' + id,
    method: 'delete'
  })

  // 图片上传
  
}
export function FileTransfer(data) {
  return request({
    url: `/FileTransfer/upload/${data.get('id')}`, // 从 FormData 中获取 id
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data' // 必须设置这个头部，才能正确处理文件上传
    }
  });
}


export function GetAreaName(){
  return request({
    url: '/Task Force/TaskForce/GetAreaName',
    method: 'get'
  })
}

